<?php

	class Usager{
		
		public $valeur;
		public $id;
		
		function Usager($i,$n){
			$this->id=$i;
			$this->valeur=$n;
		}
		
		
		
		
	}
	
	require_once("../test/php_connect.php");
	$connexion = new PDO('mysql:host='.$PARAM_hote.';dbname='.$PARAM_nom_bd, $PARAM_utilisateur, $PARAM_mot_passe);
	
	$sql="SELECT * FROM usager INNER JOIN etablissement ON etablissement.id_etablissement=usager.id_etablissement";
	$query = $connexion->query($sql);
	$tab_resul = array();
	 foreach($query as $row){
	   
		 $usager = new Usager($row['id_usager'],$row['nom_etablissement']);
		 array_push($tab_resul,$usager);
	 }
	echo json_encode($tab_resul);


?>